function test() {
    var sum = 2
}

var test = test();

console.log(sum);